package Text_62;

import java.util.Map;
import java.util.TreeMap;

public class Code {

	public static void main(String[] args) {
		TreeMap<Student,String> tm = new TreeMap<>();
        Student s1 = new Student("张三",22);
        Student s2 = new Student("李四",12);
        Student s3 = new Student("王五",33);
        Student s4 = new Student("小二",11);
        tm.put(s1,"江苏");
        tm.put(s2,"北京");
        tm.put(s3,"河南");
        tm.put(s4,"四川");
        System.out.println(tm);
        //Set<Map.Entry<Student, String>> entries = tm.entrySet();
        for(Map.Entry<Student, String> entry:tm.entrySet()){
            Student key = entry.getKey();
            String value = entry.getValue();
            System.out.print(key+"="+value+" ");
        }


	}

}
